/*
 * @Author: szx
 * @Date: 2022-05-21 13:20:44
 * @LastEditTime: 2022-05-21 13:26:17
 * @Description: 
 * @FilePath: \leetcode\200-299\268\268.js
 */
/**
 * @param {number[]} nums
 * @return {number}
 */
 var missingNumber = function (nums) {
    const sum = nums.reduce((a, b) => a + b)
    const target = ((1 + nums.length) * nums.length) >> 1;
    return target-sum;
};